import App from './App'

import cnodeModel from '@/api/api.js';
Vue.prototype.$api = cnodeModel //挂载到Vue的原型上
import store from './store'
Vue.prototype.$store = store;
import queue from './common/queue'
Vue.prototype.$queue = queue;
// 防重复点击
import noclickfrom from './common/noclick.js'
Vue.prototype.$noMultipleClicks = noclickfrom.noMultipleClicks;
// 复制
// import VueClipboard from 'vue-clipboard2'
// Vue.use(VueClipboard)

import copyTxt from './common/copyTxt'
Vue.prototype.$copyTxt = copyTxt.copyText

// //路由守卫
// import {router,RouterMount} from './router.js'  
// Vue.use(router)
//计算精度问题
import calculation from './utils/calculation.js'
Vue.prototype.$calculation = calculation
// https://blog.csdn.net/weixin_47873655/article/details/124899154 编译条件判断
// uniapp判断当前运行环境 app h5 微信小程序 百度小程序
// #ifdef H5
// 利用window.sessionStorage.setItem将获取到的页面路径进行缓存
// 解决安卓注册config正常 则ios注册config 签名错误问题： 原因是ios 无论路由跳转多少次，复制出来的链接都是首次进入的页面的链接
window.sessionStorage.setItem('firstEntryUrl', window.location.href.split('#')[0])
Vue.config.ignoredElements = [...Vue.config.ignoredElements, 'wx-open-launch-weapp']
// #endif

let uploadFileurl, domainName, baseUrl, appId, baseImgUrl, publicKey,baseUrlOrder,mainImageUrl

// #ifdef H5-DEV || WX-DEV 
//开发环境
// baseUrl = 'https://pay.frp.yedaoyun.com/beeToken/equity' //内网穿透
// baseUrlOrder = 'https://pay.frp.yedaoyun.com/beeToken/order'  //内网穿透支付

// baseUrl = 'https://test.coco.milianmeng.net/beeToken/equity'  //测试
// baseUrlOrder = 'https://test.coco.milianmeng.net/beeToken/order'  //测试支付

// baseUrl = 'https://coco.milianmeng.net/beeToken/equity'  //正式
// baseUrlOrder = 'https://coco.milianmeng.net/beeToken/order'  //正式支付

// baseUrl = 'http://192.168.0.167:6085/beeToken/equity'  //刘炜
// baseUrlOrder = 'http://192.168.0.167:6087/beeToken/order'  //刘炜

// baseUrl = 'http://192.168.0.21:6085/beeToken/equity'  //明哥
// baseUrlOrder = 'http://192.168.0.21:6087/beeToken/order'  //明哥

baseUrl = 'http://192.168.0.168:6085/beeToken/equity'  //松祥
baseUrlOrder = 'http://192.168.0.168:6087/beeToken/order'  //松祥

// baseUrl = 'http://192.168.0.20:6085/beeToken/equity'  //明宇
// baseUrlOrder = 'http://192.168.0.20:6087/beeToken/order'  //明宇

mainImageUrl = 'https://coco.milianmeng.net/resource' //网络图片地址
baseImgUrl = 'https://www.milianmeng.net/'
domainName = 'http://192.168.0.112:8099'
// appId = 'wxd1fecbb06631a19a'  // 刘大哥测试号
// appId = 'wxd5b3d18184138ef0'  // 模文的测试号  
// appId = 'wxad8262868cf1be3b'  // 运豪的测试号
// appId = 'wxb7f6ee0e1f91499a' // 神椰公众号
// appId = 'wx1540c7692b0ffe13'  //卡优优
// #ifdef H5
  appId = 'wxb7f6ee0e1f91499a'
// #endif
// #ifdef MP-WEIXIN
  appId = 'wx25d0502c5490aacd'
// #endif
publicKey =
	'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/yQrLWQTYZaQyTt/CVTmf+4di+Ge4tItryNoICVnTo2CIfxMCnwEgE0/Fz3RXvk05VxMSwxVI/NDUBpbbZT7RsMVIZmzkbyHftKheUvdQnLrTAHrrg4nAQK+bXnuv/am9RgGQnDueNLOqc/fVMm5CHirf5b6eemBldQyOUXFsrwIDAQAB' //加密公钥'
// #endif

// #ifdef H5-TEST || WX-TEST 
//测试环境
baseUrl = 'https://test.coco.milianmeng.net/beeToken/equity'
mainImageUrl = 'https://test.coco.milianmeng.net/resource' //网络图片地址
baseUrlOrder = 'https://test.coco.milianmeng.net/beeToken/order' 
domainName = 'https://test.coco.milianmeng.net'
// #ifdef H5
  appId = 'wxb7f6ee0e1f91499a'
// #endif
// #ifdef MP-WEIXIN
  appId = 'wx25d0502c5490aacd'
// #endif
baseImgUrl = 'https://www.milianmeng.net/'
publicKey =
	'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/yQrLWQTYZaQyTt/CVTmf+4di+Ge4tItryNoICVnTo2CIfxMCnwEgE0/Fz3RXvk05VxMSwxVI/NDUBpbbZT7RsMVIZmzkbyHftKheUvdQnLrTAHrrg4nAQK+bXnuv/am9RgGQnDueNLOqc/fVMm5CHirf5b6eemBldQyOUXFsrwIDAQAB' //加密公钥
// #endif
// #ifdef H5-PROD || WX-PROD
// 生产环境
baseUrl = 'https://coco.milianmeng.net/beeToken/equity'
mainImageUrl = 'https://coco.milianmeng.net/resource' //网络图片地址
baseUrlOrder = 'https://coco.milianmeng.net/beeToken/order'
domainName = 'https://coco.milianmeng.net'
// #ifdef H5
  appId = 'wxb7f6ee0e1f91499a'
// #endif
// #ifdef MP-WEIXIN
  appId = 'wx25d0502c5490aacd'
// #endif
baseImgUrl = 'https://www.milianmeng.net/'
publicKey =
	'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/yQrLWQTYZaQyTt/CVTmf+4di+Ge4tItryNoICVnTo2CIfxMCnwEgE0/Fz3RXvk05VxMSwxVI/NDUBpbbZT7RsMVIZmzkbyHftKheUvdQnLrTAHrrg4nAQK+bXnuv/am9RgGQnDueNLOqc/fVMm5CHirf5b6eemBldQyOUXFsrwIDAQAB' //加密公钥
// #endif
Vue.prototype.baseUrl = baseUrl //图片上传地址
Vue.prototype.$baseUrlOrder = baseUrlOrder //订单地址
Vue.prototype.mainImageUrl = mainImageUrl //网络图片地址
Vue.prototype.baseImgUrl = baseImgUrl //图片上传地址
Vue.prototype.uploadFileurl = baseUrl + '/common/v1/upload' //图片上传地址
Vue.prototype.domainName = domainName //分享地址
Vue.prototype.appId = appId //公众号appid
Vue.prototype.publicKey = publicKey //加密公钥



// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})

app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif